package com.briup.myblog.exception;

import com.briup.myblog.utils.ResultStatus;

/**
 * 自定义异常类
 */
public class CustomerException extends RuntimeException{
    private int status;
    private String message;
    private ResultStatus result;
    public CustomerException(String message) {
        super(message);
        this.message = message;
    }
    public CustomerException(ResultStatus result){
        super(result.getMessage());
        this.result = result;
        this.message = result.getMessage();
        this.status =  result.getStatus();
    }

    public int getStatus() {
        return status;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public ResultStatus getResult() {
        return result;
    }
}